#define _CRT_SECURE_NO_WARNINGS

#include "BinaryTree.h"


int TreeSize(BTNode* root)
{
	if (root == NULL)
	{
		return 0;
	}
	return 1 + TreeSize(root->left) + TreeSize(root->right);
}

void PrevOreder(BTNode* root)
{
	if (root == NULL)
	{
		printf("NULL ");
		return;
	}

	printf("%c ", root->date);
	PrevOreder(root->left);
	PrevOreder(root->right);

}

void InOreder(BTNode* root)
{
	if (root == NULL)
	{
		printf("NULL ");
		return ;
	}
	
	InOreder(root->left);
	printf("%c ", root->date);
	InOreder(root->right);
}
void PostOreder(BTNode* root)
{
	if (root == NULL)
	{
		printf("NULL ");
		return ;
	}

	PostOreder(root->left);
	PostOreder(root->right);
	printf("%c ", root->date);

}

int TreeLeafSize(BTNode* root)
{
	if (root == NULL)
	{
		return 0;
	}

	if (root->left == NULL && root->right == NULL)
	{
		return 1;
	}

	return TreeLeafSize(root->left) + TreeLeafSize(root->right);
}